/*
 * @Descripttion: 
 * @version: 
 * @Author: turingchang
 * @Date: 2020-08-28 13:44:08
 * @LastEditors: turingchang
 * @LastEditTime: 2020-08-28 17:03:23
 */
'use strict';

module.exports = app => {
  const {
    STRING,
    INTEGER,
    DATE,
    DataTypes
  } = app.Sequelize;



  const User = app.model.define(
    'user', {
      id: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      name: STRING(50),
      age: {
        type: INTEGER,
        defaultValue:18,
      },
      sex:{
        type: INTEGER,
        defaultValue:1,
      },
      create_time: {
        type: INTEGER,
        defaultValue:Date.now(),
      },
    },
    {
      tableName: 'user', //自定义映射数据库真实表名
      timestamps:false,
    },
  );

  return User;
};